version 11
	/* THE FILE GENERATES VARIABLE TAXRATE ACCORDING TO TAX SCHEDULE OF PAKISTAN */
	set more off
	matrix input tax_rates=(0.5 ,1   ,   2,  3,  4,  5,7.5,10 ,12.5,15,19,21  ,  25, 0, 0, 0  ,    0,   0, 0, 0\						///
							0.25,0.5 ,0.75,1.5,2.5,3.5,4.5,6  , 7.5, 9,10,11  ,12.5,14,15,16  , 17.5,18.5,19,20\						///	
							0.5 ,0.75,1.5 ,2.5,3.5,4.5,6  ,7.5,   9,10,11,12.5,	 14,15,16,17.5,	18.5,  19,20, 0\						///
							7.5 ,10  ,  15,20 , 25,0  ,0  ,0  ,0   ,0 , 0,   0,   0, 0, 0,   0,    0,   0, 0, 0)
	gen taxrate_se=0
	local i=1
	foreach z in 100 110 125 150 175 200 300 400 500 600 800 1000 1300 { 
			replace taxrate_se=tax_rates[1,`i'] if taxableinc > (`z'*1000) & (year==2006 | year==2007 |year==2008 |year==2009) 
			local i=`i'+1
	}

	local i=1
	foreach z in 300 500 750 1000 1500  { 
			replace taxrate_se=tax_rates[4,`i'] if taxableinc > (`z'*1000) & (year==2010 | year==2011) 
			local i=`i'+1
	}
	replace taxrate_se=0 if taxableinc<=350000 & year==2011 
	replace taxrate_se=. if taxableinc==.
	replace taxrate_se=0 if taxableinc<=0
